export default {
    install(Vue) {
        Vue.directive('hasMenu', {
            inserted(el, bindings) {
                const arr = JSON.parse(localStorage.getItem('menulist'))
                console.log('json',arr);
                const has = bindings.value
                const hasPermission = arr.includes(has)
                if (!hasPermission) {
                    el.style.display = 'none'
                    setTimeout(() => {
                        el.parentNode.removeChild(el)
                    }, 0)
                }
            }
        })
    },
}